#include "userqlabel.h"
#include <QLabel>

ClientQLabel::ClientQLabel(QWidget *par,int xxa):QLabel(par),xa(xxa){
    setStyleSheet("background-color:rgba(0,0,0,0.2);font-size:40px;"
                  "vertical-align:top;text-align:left;border-color:rgba(0,0,0,1);"
                  "border-radius:5px;border-width:2px;border-style: solid;");
    setGeometry(xa,paddingTop,width,height);

    cardNum=new QLabel(this);
    nameLabel=new QLabel(this);
    buChu=new QLabel(nameLabel);

    cardNum->setStyleSheet("font-size:40px;text-align:center;");
    nameLabel->setStyleSheet("font-size:40px;text-align:center;");

    nameLabel->setGeometry(padding,padding,width-2*padding,height-2*padding-cardNumSize-distance);
    cardNum->setGeometry(padding,height-padding-cardNumSize,width-2*padding,cardNumSize);
    buChu->setGeometry(padding,padding,width-4*padding,40);

    buChu->setText("不出");

    buChu->hide();

    hide();
}

void ClientQLabel::setName(const QString &name){
    nameLabel->setText(name);
}

void ClientQLabel::setNum(int x){
    cardNum->setText(QString::number(x));
}

void ClientQLabel::hideNum(){
    cardNum->hide();
}

void ClientQLabel::showNum(){
    cardNum->show();
}

ClientQLabel::~ClientQLabel(){
    delete cardNum;
    delete nameLabel;
    delete buChu;
}
